package org.liaohailong.library;

import androidx.annotation.NonNull;

/**
 * Author: liaohailong
 * Date: 2025/4/8
 * Time: 15:09
 * Description:
 **/
public class HelloVideoCache {

    static {
        System.loadLibrary("hellovideocache");
    }

    protected final long mPtr;

    public HelloVideoCache() {
        mPtr = nativeInit();
    }

    public void setConfig(@NonNull HelloVideoCacheConfig config) {
        nativeSetConfig(mPtr, config);
    }

    public void start() {
        nativeStart(mPtr);
    }

    public void stop() {
        nativeStop(mPtr);
    }

    public void release() {
        nativeRelease(mPtr);
    }


    protected native long nativeInit();

    protected native void nativeSetConfig(long ptr, @NonNull HelloVideoCacheConfig config);

    protected native void nativeStart(long ptr);

    protected native void nativeStop(long ptr);

    protected native void nativeRelease(long ptr);
}
